package com.example.multithread.chapter02;

import java.util.concurrent.ThreadFactory;

/**
 * @ClassName MyThreadFactory
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2020/4/29 9:58 AM
 * @Version 1.0
 */
public class MyThreadFactory implements ThreadFactory {
	public MyThreadFactory(String name) {
		this.name = name;
	}
	private String name;
	@Override
	public Thread newThread(Runnable r) {
		Thread thread = new Thread(r);
		thread.setName(name);
		return thread;
	}
}
